<template>
  <div class="generalize">
    <div v-if="!$store.state.isbusNewsDitle">
      <!-- <img
        src="../../../assets/imges/gongjiaoxinwen.png"
        alt=""
      > -->
      <ul class="news_list">
        <li
          class="news_item"
          v-for="item in sonList"
          :key="item.id"
        >
          <i class="news_d"></i>
          <span
            @click="handDitle(item)"
            class="news_title ellipse pointer"
          >{{item.title}}</span>
          <span
            v-if='item.sta==1'
            class="str_new"
          >[ 新 ]</span>
        </li>
      </ul>
      <div class="page_box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[5,10,15]"
          :page-size="pageBid3.limit"
          layout="total, prev, pager, next, jumper"
          :total="pageBid3.totalCount"
        >
        </el-pagination>
        <!-- <router-view></router-view> -->
      </div>
    </div>
    <transition name="fade">
      <div
        v-if="$store.state.isbusNewsDitle"
        class="busDitle_dog"
      >
        <mydetails
          :sonList="sonList"
          :dateils="dateils"
        ></mydetails>
      </div>
    </transition>

  </div>
</template>

<script>
import busNewsDitle from "./busNewsDitle";
export default {
  props: {
    sonList: {
      type: Array
    },
    count: {
      type: Number
    }
  },

  watch: {
    count(newlIst, olist) {
      this.pageBid3.totalCount = newlIst;
    },
    sonList(newlIst, olist) {
      newlIst.forEach(item => {
        item.img = this.$store.state.baseUrl + item.img;
      });
    }
  },
  name: "generalize.vue",
  components: {
    busNewsDitle
  },
  data() {
    return {
      isbusNewsDitle: false,
      pageBid3: {
        start: 1,
        limit: 10,
        totalCount: 0,
        tatalpage: 0
      },
      newsList: [],
      dateils: {}
    };
  },
  mounted() {
    if (this.count != 0) {
      this.pageBid3.totalCount = this.count;
    }
  },
  methods: {
    handDitle(item) {
      this.dateils = item;
      this.$store.commit("handBus", true);
    },
    handleSizeChange() {},
    handleCurrentChange(val) {
      this.$emit("handSonNav", this.$parent.activeId, val, 10);
    }
  }
};
</script>

<style lang='scss' scoped>
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-active {
  opacity: 0;
}
.generalize {
  .busDitle_dog {
    background-color: #fff;
  }
}
.page_box {
  text-align: center;
  margin-top: 70px;
  margin-bottom: 30px;
}
.news_list {
  margin-top: 40px;
  .news_title:hover {
    color: #1792cf !important;
  }
  .news_item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    .news_d {
      display: block;
      width: 8px;
      height: 8px;
      background-color: #1c89e0;
      margin-right: 20px;
      border-radius: 50%;
    }
    .news_title {
      color: #333333;
      font-size: 16p;
      max-width: 455px;
    }
    .str_new {
      color: #e6142f;
      font-size: 16px;
      margin-left: 36px;
    }
  }
}
.crumbs_cont_txt {
  margin-top: 40px;
  font-size: 16px;
  font-weight: 400;
  line-height: 35px;
  color: rgba(51, 51, 51, 1);
}
</style>
